package com.soteind.dao;

// Generated 13/11/2012 02:06:47 AM by Hibernate Tools 3.4.0.CR1

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.soteind.entity.VOrdenC;
import com.soteind.entity.VOrdenCId;

/**
 * Home object for domain model class VOrdenC.
 * @see com.soteind.entity.VOrdenC
 * @author Hibernate Tools
 */
@Stateless
public class VOrdenCHome {

	private static final Log log = LogFactory.getLog(VOrdenCHome.class);

	@PersistenceContext
	private EntityManager entityManager;

	public void persist(VOrdenC transientInstance) {
		log.debug("persisting VOrdenC instance");
		try {
			entityManager.persist(transientInstance);
			log.debug("persist successful");
		} catch (RuntimeException re) {
			log.error("persist failed", re);
			throw re;
		}
	}

	public void remove(VOrdenC persistentInstance) {
		log.debug("removing VOrdenC instance");
		try {
			entityManager.remove(persistentInstance);
			log.debug("remove successful");
		} catch (RuntimeException re) {
			log.error("remove failed", re);
			throw re;
		}
	}

	public VOrdenC merge(VOrdenC detachedInstance) {
		log.debug("merging VOrdenC instance");
		try {
			VOrdenC result = entityManager.merge(detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public VOrdenC findById(VOrdenCId id) {
		log.debug("getting VOrdenC instance with id: " + id);
		try {
			VOrdenC instance = entityManager.find(VOrdenC.class, id);
			log.debug("get successful");
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}
}
